<%--
  Created by IntelliJ IDEA.
  User: LT
  Date: 2018-10-25
  Time: 15:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link href="${pageContext.request.contextPath}/statics/hplus/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/statics/hplus/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/statics/hplus/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/bootstrap.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/hplus/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>


    <link rel="stylesheet" href="${pageContext.request.contextPath}/statics/date/bootstrap-datetimepicker.min.css">
    <script src="${pageContext.request.contextPath}/statics/date/Moment.js"></script>
    <script src="${pageContext.request.contextPath}/statics/date/bootstrap-datetimepicker.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/bootstrapvalidator/bootstrapValidator.min.js"></script>

    <script>
        function searcha() {
            var opts = $("#usertb").bootstrapTable("getOptions") ;
            var limit = opts.pageSize ;
            var offset = (opts.pageNumber-1) * limit;
            var username = $("#username").val() ;
            $.post("${pageContext.request.contextPath}/huiyuan/fenyemohchax1",{'username':username,'limit':limit,'offset':offset},function (data) {
                // var mydata = eval("("+data+")") ;
                //重新绑定表格数据
                $("#usertb") .bootstrapTable('load',data) ;
            })
        }

        $(function () {

            $("#dd").on("dbl-click-row.bs.table",function (e,row,ele) {
                $("[name=taocan_Name]").val(row.taocan_Name);
                $("[name=xiangmuleixing_Name]").val(row.xiangmuleixing_Name);
                $("[name=taocan_Id]").val(row.taocan_Id);
                $("[name=chanpindanwei_name]").val(row.chanpindanwei_name);
                $("[name=taocan_Jiage]").val(row.taocan_Jiage);
                $("#showtaocanxq").modal('hide')
            })
            //校验
            $(function () {
                $('#fm').bootstrapValidator({
                    message: '',
                    feedbackIcons: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        huiyuan_Name: {
                            message: '',
                            validators: {
                                notEmpty: {
                                    message: '会员姓名不能为空！'
                                }
                            }
                        },
                        phone: {
                            message: '',
                            validators: {
                                notEmpty: {
                                    message: '联系电话不能为空！'
                                }
                            }
                        },
                        jinJi_Phone: {
                            message: '',
                            validators: {
                                notEmpty: {
                                    message: '紧急联系电话不能为空！'
                                }
                            }
                        },
                        huiyuan_Kahao: {
                            message: '',
                            validators: {
                                notEmpty: {
                                    message: '会员卡号不能为空！'
                                }
                            }
                        },
                        kanei_JinE: {
                            message: '',
                            validators: {
                                notEmpty: {
                                    message: '卡内金额不能为空！'
                                }
                            }
                        },
                        miMa: {
                            message: '',
                            validators: {
                                notEmpty: {
                                    message: '密码不能为空！'
                                }
                            }
                        }
                    }
                });

                $("#usertb").bootstrapTable({
                    url:'${pageContext.request.contextPath}/huiyuan/fenyemohchax1',
                    //设置每页多少条数据
                    pageSize:2,
                    pageList:[2,4,8,16],
                    height:300,
                    pageNumber:1,
                    //启用分页，但是默认情况下，是客户端分页的
                    pagination:true,
                    //启用服务器端分页
                    sidePagination:'server',
                    queryParams:function(params){
                        var temp = {  //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                            limit: params.limit,  //页面大小
                            offset: params.offset, //页码
                            username:$("#username").val()
                        };
                        return temp;
                    },
                    columns:[
                        {
                            field:'huiyuan_Id',
                            title:'会员编号'
                        },
                        {
                            field:'huiyuan_Name',
                            title:'会员姓名'
                        },
                        {
                            field:'huiyuan_Kahao',
                            title:'会员卡号'
                        },
                        {
                            field:'huiyuanleixing_Name',
                            title:'会员类型'
                        },
                        {
                            field:'huiyuan_Xingbie',
                            title:'性别'
                        },
                        {
                            field:'phone',
                            title:'联系电话'
                        },
                        {
                            field:'kanei_JinE',
                            title:'卡内余额'
                        },
                        {
                            field:'huiyuan_Jifen',
                            title:'会员积分'
                        },
                        {
                            field:'dianpu_Name',
                            title:'开卡店铺'
                        },
                        {
                            field:'jingbane_Name',
                            title:'经办人'
                        },
                        {
                            field:'zhuangtai',
                            title:'状态',
                            formatter:function (a,b,c) {
                                if (b.zhuangtai==1){
                                    return "启用" ;
                                }
                                else{
                                    return "禁用" ;
                                }
                            }
                        },
                        {
                            title:'操作',
                            formatter:function (value,row,index) {
                                return   "<button class='btn btn-primary' onclick='javascript:sc("+row.huiyuan_Id+")'>删除</button> &nbsp;"+
                                    "<button class='btn btn-primary' onclick='javascript:xgai("+row.huiyuan_Id+")'>修改</button> &nbsp;"+
                                    "<button class='btn btn-primary' onclick='javascript:chognzhi("+row.huiyuan_Id+")'>充值</button> &nbsp;"
                            }
                        },
                    ]
                }) ;

                $(".taocanxiangqing").bootstrapTable({
                    url:'${pageContext.request.contextPath}/taocan/chax1',
                    //设置每页多少条数据
                    pageSize:4,
                    pageList:[2,4,6,8,16],
                    height:300,
                    pageNumber:1,
                    //启用分页，但是默认情况下，是客户端分页的
                    pagination:true,
                    columns:[
                        {
                            field:'taocan_Id',
                            title:'编码'
                        },
                        {
                            field:'taocan_Name',
                            title:'名称'
                        },
                        {
                            field:'xiangmuleixing_Name',
                            title:'分类'
                        },
                        {
                            field:'chanpindanwei_name',
                            title:'单位'
                        },
                        {
                            field:'taocan_Jiage',
                            title:'现价'
                        }
                    ]
                }) ;





                //1.添加绑定会员类型
                $.post("/huiyuanleixing/chax",function (data) {
                    var opt = " ";
                    $.each(data,function (index,item) {
                        var id=item.huiyuanleixing_Id;
                        var name=item.huiyuanleixing_Name;
                        opt +="<option value="+id+">"+name+"</option>"
                        // alert(id +"---"+ name);
                    })
                    $("select[name='huiyuanleixing_Id']").html(opt);
                })

                //2.添加绑定付款方式
                $.post("/chongzhi/chax",function (data) {
                    var opt = " ";
                    $.each(data,function (index,item) {
                        var id=item.chognzhi_Id;
                        var name=item.chongzhi_Name;
                        opt += "<option value="+id+">"+name+"</option>"
                    })
                    $("select[name='chognzhi_Id']").html(opt);
                })

                //3.添加绑定操作店铺
                $.post("/dianpu/chax",function (data) {
                    var opt = " ";
                    $.each(data,function (index,item){
                        var id=item.dianpu_Id;
                        var name=item.dianpu_Name;

                        // alert(id +"---"+ name)
                        opt +="<option value="+id+">"+name+"</option>"
                    })
                    $("select[name='dianpu_Id']").html(opt);
                })

                //4.添加经办人作店铺
                $.post("/banliren/chax",function (data) {
                    var opt = " ";
                    $.each(data,function (index,item){
                        var id=item.jinbanr_Id;
                        var name=item.jingbane_Name;

                        // alert(id +"---"+ name)
                        opt +="<option value="+id+">"+name+"</option>"
                    })
                    $("select[name='jinbanr_Id']").html(opt);
                })

            }) ;

            //1.去修改绑定会员类型
            $.ajaxSettings.async = false;
            $.post("/huiyuanleixing/chax",function (data) {
                var opt = " ";
                $.each(data,function (index,item) {
                    var id=item.huiyuanleixing_Id;
                    var name=item.huiyuanleixing_Name;
                    opt +="<option value="+id+">"+name+"</option>"
                    // alert(id +"---"+ name);
                })
                $("select[name='huiyuanleixing_Idg']").html(opt);
            })

            //2.去修改绑定付款方式
            $.ajaxSettings.async = false;
            $.post("/chongzhi/chax",function (data) {
                var opt = " ";
                $.each(data,function (index,item) {
                    var id=item.chognzhi_Id;
                    var name=item.chongzhi_Name;
                    opt += "<option value="+id+">"+name+"</option>"
                })
                $("select[name='chognzhi_Idg']").html(opt);
            })

            //3.去修改绑定操作店铺
            $.ajaxSettings.async = false;
            $.post("/dianpu/chax",function (data) {
                var opt = " ";
                $.each(data,function (index,item){
                    var id=item.dianpu_Id;
                    var name=item.dianpu_Name;
                    opt +="<option value="+id+">"+name+"</option>"
                })
                $("select[name='dianpu_Idg']").html(opt);
            })

            //4.去修改经办人作店铺
            $.ajaxSettings.async = false;
            $.post("/banliren/chax",function (data) {
                var opt = " ";
                $.each(data,function (index,item){
                    var id=item.jinbanr_Id;
                    var name=item.jingbane_Name;
                    // alert(id +"---"+ name)
                    opt +="<option value="+id+">"+name+"</option>"
                })
                $("select[name='jinbanr_Idg']").html(opt);
            })

        });

        //添加
        function add() {
            $("#Div3").modal('show');
        }
        function dotianjia() {
            var huiyuan_Name=$("[name=huiyuan_Name]").val();
            //性别
            var huiyuan_Xingbie=$("[name=huiyuan_Xingbie]").val();
            var huiyuan_Xingbie=null;
            if ($("[name=huiyuan_Xingbie]")[0].checked){
                huiyuan_Xingbie=$("[name=huiyuan_Xingbie]").eq(0).val();
            }
            if ($("[name=huiyuan_Xingbie]")[1].checked){
                huiyuan_Xingbie=$("[name=huiyuan_Xingbie]").eq(1).val();
            }
            var phone=$("[name=phone]").val();
            var huiyuan_Jifen=$("[name=huiyuan_Jifen]").val();
            var jinJi_Phone=$("[name=jinJi_Phone]").val();
            var huiyuanleixing_Id=$("[name=huiyuanleixing_Id]").val();
            var huiyuan_Kahao=$("[name=huiyuan_Kahao]").val();
            var kanei_JinE=$("[name=kanei_JinE]").val();
            var chognzhi_Id=$("[name=chognzhi_Id]").val();
            var miMa=$("[name=miMa]").val();
            var dianpu_Id=$("[name=dianpu_Id]").val();
            var jinbanr_Id=$("[name=jinbanr_Id]").val();
            //状态
            var zhuangtai=$("[name=zhuangtai]").val();
            var zhuangtai=null;
            if ($("[name=zhuangtai]")[0].checked){
                zhuangtai=$("[name=zhuangtai]").eq(0).val();
            }
            if ($("[name=zhuangtai]")[1].checked){
                zhuangtai=$("[name=zhuangtai]").eq(1).val();
            }
            var beiZhu=$("[name=beiZhu]").val();
            // alert(huiyuan_Name)
            // alert(chognzhi_Id)
            // alert(zhuangtai)
            $.post("${pageContext.request.contextPath}/huiyuan/tianjia1",{'huiyuan_Name':huiyuan_Name,'huiyuan_Xingbie':huiyuan_Xingbie,'phone':phone,'huiyuan_Jifen':huiyuan_Jifen,'jinJi_Phone':jinJi_Phone,'huiyuan_Kahao':huiyuan_Kahao,'huiyuan_Leibie':huiyuanleixing_Id,'kanei_JinE':kanei_JinE,'miMa':miMa,'fukuanFangShi':chognzhi_Id,'banlirenid':jinbanr_Id,'caozuoDianpu':dianpu_Id,'zhuangtai':zhuangtai,'beiZhu':beiZhu},function (data) {
                if (data!=null){
                    alert("添加成功");
                    searcha();
                    $("#Div3").modal("hide");
                }else {
                    alert("添加失败")
                }
            })

        }


        //删除
        var huiyuan_Id;
        function sc(huiyuan_Ids) {
            huiyuan_Id=huiyuan_Ids;
            $("#sc").modal('show');
        }
        function dodelete() {
            $.post('${pageContext.request.contextPath}/huiyuan/sc1',{huiyuan_Id:huiyuan_Id},function (data) {
                if (data!=null){
                    searcha();
                    $("#sc").modal('hide');
                }
            })
            searcha();
        }

        //根据修改编号
        var huiyuan_Id=0;
        function xgai(id) {
            huiyuan_Id=id;
            $("#Div4").modal('show')
            $.post('${pageContext.request.contextPath}/huiyuan/xgaiid1',{huiyuan_Id:huiyuan_Id},function (data) {
                //给表单赋值
                $("[name=huiyuan_Nameg]").val(data.huiyuan_Name);
                //性别
                $("[name=huiyuan_Xingbieg]").val(data.huiyuan_Xingbie);
                var huiyuan_Xingbie=data.huiyuan_Xingbie;
                if (huiyuan_Xingbie=="男"){
                    huiyuan_Xingbie=$("[name=huiyuan_Xingbieg]").eq(0).attr("checked","checked");
                }else
                {
                    huiyuan_Xingbie=$("[name=huiyuan_Xingbieg]").eq(1).attr("checked","checked");
                }
                $("[name=phoneg]").val(data.phone);
                $("[name=huiyuan_Jifeng]").val(data.huiyuan_Jifen);
                $("[name=jinJi_Phoneg]").val(data.jinJi_Phone);
                $("[name=huiyuanleixing_Idg]").val(data.huiyuan_Leibie);
                $("[name=huiyuan_Kahaog]").val(data.huiyuan_Kahao);
                $("[name=kanei_JinEg]").val(data.kanei_JinE);
                $("[name=chognzhi_Idg]").val(data.fukuanFangShi);
                $("[name=miMag]").val(data.miMa);
                $("[name=dianpu_Idg]").val(data.caozuoDianpu);
                $("[name=jinbanr_Idg]").val(data.banlirenid);
                //状态
                $("[name=zhuangtaig]").val(data.zhuangtai);
                var zhuangtai=data.zhuangtai;
                if (zhuangtai==1){
                    zhuangtai=$("[name=zhuangtaig]").eq(0).attr("checked","checked");
                }else
                {
                    zhuangtai=$("[name=zhuangtaig]").eq(1).attr("checked","checked");
                }
                $("[name=beiZhug]").val(data.beiZhu);

            })
        }

        //修改
        var kanei_JinEg =0 ;
        function doxgai() {
            var huiyuan_Nameg=$("[name=huiyuan_Nameg]").val();
            //性别
            var huiyuan_Xingbieg=$("[name=huiyuan_Xingbieg]").val();
            var huiyuan_Xingbieg=null;
            if ($("[name=huiyuan_Xingbieg]")[0].checked){
                huiyuan_Xingbieg=$("[name=huiyuan_Xingbieg]").eq(0).val();
            }
            if ($("[name=huiyuan_Xingbieg]")[1].checked){
                huiyuan_Xingbieg=$("[name=huiyuan_Xingbieg]").eq(1).val();
            }
            var phoneg=$("[name=phoneg]").val();
            var huiyuan_Jifeng=$("[name=huiyuan_Jifeng]").val();
            var jinJi_Phoneg=$("[name=jinJi_Phoneg]").val();
            var huiyuanleixing_Idg=$("[name=huiyuanleixing_Idg]").val();
            var huiyuan_Kahaog=$("[name=huiyuan_Kahaog]").val();
            kanei_JinEg=$("[name=kanei_JinEg]").val();
            var chognzhi_Idg=$("[name=chognzhi_Idg]").val();
            var miMag=$("[name=miMag]").val();
            var dianpu_Idg=$("[name=dianpu_Idg]").val();
            var jinbanr_Idg=$("[name=jinbanr_Idg]").val();
            //状态
            var zhuangtaig=$("[name=zhuangtaig]").val();
            var zhuangtaig=null;
            if ($("[name=zhuangtaig]")[0].checked){
                zhuangtaig=$("[name=zhuangtaig]").eq(0).val();
            }
            if ($("[name=zhuangtaig]")[1].checked){
                zhuangtaig=$("[name=zhuangtaig]").eq(1).val();
            }
            var beiZhug=$("[name=beiZhug]").val();
            $.post('${pageContext.request.contextPath}/huiyuan/xgai1',{huiyuan_Id:huiyuan_Id,huiyuan_Name:huiyuan_Nameg,huiyuan_Xingbie:huiyuan_Xingbieg,phone:phoneg,huiyuan_Jifen:huiyuan_Jifeng,jinJi_Phone:jinJi_Phoneg,huiyuan_Leibie:huiyuanleixing_Idg,huiyuan_Kahao:huiyuan_Kahaog,kanei_JinE:kanei_JinEg,fukuanFangShi:chognzhi_Idg,miMa:miMag,caozuoDianpu:dianpu_Idg,banlirenid:jinbanr_Idg,zhuangtai:zhuangtaig,beiZhu:beiZhug},function (data) {
                if (data!=null){
                    alert("修改成功")
                    searcha();
                    $("#Div4").modal('hide')
                } else {
                    alert("修改失败")
                }
            })
        }

        //积分
        var huiyuan_Id=0;
        function jifen(id) {
            huiyuan_Id=id;
            $("#Div5").modal('show')
            $.post('${pageContext.request.contextPath}/huiyuan/xgaiid1',{huiyuan_Id:huiyuan_Id},function (data) {
                $("[name=huiyuan_Name]").val(data.huiyuan_Name);
                $("[name=huiyuan_Jifenf]").val(data.huiyuan_Jifen);

            })
        }

        function dojifen() {
            var huiyuan_Jifenf=$("[name=huiyuan_Jifenf]").val();
            var beiZhuf=$("[name=beiZhuf]").val();
            $.post('${pageContext.request.contextPath}/huiyuan/jifenxgai1',{huiyuan_Id:huiyuan_Id,huiyuan_Jifen:huiyuan_Jifenf,beiZhu:beiZhuf},function (data) {
                if (huiyuan_Jifenf==0){
                    alert("不能兑换");
                    alert("请先消费才能获取积分哦！")
                    $("#Div5").modal('hide')
                } else {
                    alert("兑换成功")
                    searcha();
                    $("#Div5").modal('hide')
                }
            })
        }


        //会员充值传值
        var huiyuan_Id=0;
        function chognzhi(id) {
            huiyuan_Id=id;
            $("#Div1").modal('show')
            $.post('${pageContext.request.contextPath}/huiyuan/xgaiid1',{huiyuan_Id:huiyuan_Id},function (data) {
                $("[name=Huiyuanchongzhi_Id]").val(data.huiyuan_Id)
                $("[name=Huiyuanchognzhi_Name]").val(data.huiyuan_Name);
            })
        }

        //会员充值
        function chongzhi() {
            $("#Div1").modal('show')
        }

        function dochognzhi() {
            var Huiyuanchongzhi_Id=$("[name=Huiyuanchongzhi_Id]").val();
            var Huiyuanchognzhi_Name=$("[name=Huiyuanchognzhi_Name]").val();
            var zhongzhijine=$("[name=zhongzhijine]").val();
            var chognzhi_Id=$("[name=chognzhi_Id]").val();
            var dianpu_Id=$("[name=dianpu_Id]").val();
            var jinbanr_Id=$("[name=jinbanr_Id]").val();
            var beizhu=$("[name=beizhu]").val();
            var xiugaijine = parseInt(zhongzhijine)+parseInt(kanei_JinEg);
            alert(zhongzhijine)
            alert(kanei_JinEg)

            $.post('${pageContext.request.contextPath}/huiyuanChongzhi/tianjia1',{'Huiyuanchongzhi_Id':Huiyuanchongzhi_Id,'Huiyuanchognzhi_Name':Huiyuanchognzhi_Name,'zhongzhijine':zhongzhijine,'fukuanfangshi':chognzhi_Id,'chpngzhidianpu':dianpu_Id,'banlirenid':jinbanr_Id,'beizhu':beizhu},function (data) {
                if (data != null){
                    alert("充值成功")
                    searcha();
                    $("#Div1").modal('hide')
                } else {
                    alert("充值失败")
                }
            })
            $.post('${pageContext.request.contextPath}/huiyuan/xiugaijine',{'huiyuan_Id':Huiyuanchongzhi_Id,"huiyuan_Jifen":xiugaijine},function (data) {
                alert(data)
                alert(xiugaijine)
                alert(Huiyuanchongzhi_Id)
            })
        }

        //套餐充值
        var huiyuan_Id=0;
        function taocan(id) {
            huiyuan_Id=id;
            $("#Div2").modal('show')
            $.post('${pageContext.request.contextPath}/huiyuan/xgaiid1',{huiyuan_Id:huiyuan_Id},function (data) {
                $("[name=taocanhuiyuan_id]").val(data.huiyuan_Id)
                $("[name=taocanhuiyuan_Name]").val(data.huiyuan_Name);
            })
        }

        function xiangqing() {
            $("#hh").modal('show')
        }

        function xuanztaocan() {
            $("#showtaocanxq").modal('show')
        }

        //套餐添加
        function doxuanztaocan() {
            var taocan_Name=$("[name=taocan_Name]").val();
            var xiangmuleixing_Name=$("[name=xiangmuleixing_Name]").val();
            var chanpindanwei_name=$("[name=chanpindanwei_name]").val();
            var taocan_Jiage=$("[name=taocan_Jiage]").val();
            var shuliang=$("[name=shuliang]").val();
            $.post("${pageContext.request.contextPath}/taocan/taocantianjia1",{taocan_Name:taocan_Name,xiangmuleixing_Name:xiangmuleixing_Name,chanpindanwei_name:chanpindanwei_name,taocan_Jiage:taocan_Jiage,shuliang:shuliang},function (data) {
                if (data != null){
                    alert("添加成功");
                    searcha();
                    $("#hh").modal("hide");
                }else {
                    alert("添加失败")
                }
            })
        }

        // 套餐充值添加
        function dotaocanchognzhitianjia() {
            var taocanhuiyuan_id=$("[name=taocanhuiyuan_id]").val();
            var taocanhuiyuan_Name=$("[name=taocanhuiyuan_Name]").val();
            var taocan_jiaofei=$("[name=taocan_jiaofei]").val();
            var chognzhi_Id=$("[name=chognzhi_Id]").val();
            var dianpu_Id=$("[name=dianpu_Id]").val();
            var beizhu=$("[name=beizhu]").val();
            var jinbanr_Id=$("[name=jinbanr_Id]").val();
            $.post("${pageContext.request.contextPath}/taocaixufei/xufeitianjia1",{'taocanhuiyuan_id':taocanhuiyuan_id,'taocanhuiyuan_Name':taocanhuiyuan_Name,'taocan_jiaofei':taocan_jiaofei,'jiaofeifangshi':chognzhi_Id,'jiaofeidainpu':dianpu_Id,'beizhu':beizhu,'banlirenid':jinbanr_Id},function (data) {
                if (data!= null){
                    alert("添加成功");
                    searcha();
                    $("#Div2").modal("hide");
                }else {
                    alert("添加失败")
                }
            })
        }
    </script>
</head>
<body>

<div class="panel panel-default">
    <div class="panel-body">
        <div class="row">
            <div class="col-sm-6">
                <button onclick="add()" class="btn btn-primary"><span class="glyphicon glyphicon-plus"></span>&nbsp;&nbsp;增加</button>
            </div>
            <div class="col-sm-6" >
                <form  class="form-inline pull-right">
                    <input id="username" type="text" placeholder="会员姓名 " class="form-control">
                    <button class="btn btn-primary" onclick="searcha()" type="button"><span class="glyphicon glyphicon-search"></span>&nbsp;&nbsp;搜索</button>
                </form>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <table id="usertb"></table>
            </div>
        </div>

    </div>
</div>

<!--增加模板-->
<div class="modal inmodal" id="Div3" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <i class="fa fa-laptop modal-icon"></i>
                <h4 class="modal-title">增加会员</h4>
            </div>
            <form method="post" class="form-horizontal" id="fm">
                <div class="modal-body">
                    <div class="ibox-content">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员姓名</label>
                            <div class="col-sm-10">
                                <input  name="huiyuan_Name" type="text" class="form-control" >
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员性别</label>
                            <div class="col-sm-10">
                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="huiyuan_Xingbie" value="男" style="margin-top: 2px"> 男
                                </div>

                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="huiyuan_Xingbie" value="女" style="margin-top: 2px"> 女
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">联系电话</label>
                            <div class="col-sm-10">
                                <input type="number" name="phone" maxlength="11" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员积分</label>
                            <div class="col-sm-10">
                                <input type="text" name="huiyuan_Jifen" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">紧急联系电话</label>
                            <div class="col-sm-10">
                                <input type="text" name="jinJi_Phone" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员类型</label>
                            <div class="col-sm-10">
                                <select name="huiyuanleixing_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员卡号</label>
                            <div class="col-sm-10">
                                <input type="text" name="huiyuan_Kahao" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">卡内金额</label>
                            <div class="col-sm-10">
                                <input type="text" name="kanei_JinE" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">付款方式</label>
                            <div class="col-sm-10">
                                <select name="chognzhi_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">密码</label>
                            <div class="col-sm-10">
                                <input type="text" name="miMa" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">操作店铺</label>
                            <div class="col-sm-10">
                                <select name="dianpu_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">经办人</label>
                            <div class="col-sm-10">
                                <select name="jinbanr_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">状态</label>
                            <div class="col-sm-10">
                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="zhuangtai" value="1" style="margin-top: 2px">启动
                                </div>

                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="zhuangtai" value="2" style="margin-top: 2px"> 禁用
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-10">
                                <input type="text" name="beiZhu" class="form-control">
                            </div>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary" onclick="dotianjia()">添加</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!---删除模态框-->
<div class="modal fade" id="sc">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="modelTitleId">提示信息</h4>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12" id="addrole" style="height: 100px">
                        <p>确认删除客户信息吗？</p>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary"onclick="dodelete()">删除</button>
            </div>
        </div>
    </div>
</div>

<!--修改模板-->
<div class="modal inmodal" id="Div4" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <i class="fa fa-laptop modal-icon"></i>
                <h4 class="modal-title">修改会员</h4>
            </div>
            <form method="post" class="form-horizontal">
                <div class="modal-body">
                    <div class="ibox-content">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员姓名</label>
                            <div class="col-sm-10">
                                <input  name="huiyuan_Nameg" type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员性别</label>
                            <div class="col-sm-10">
                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio"  name="huiyuan_Xingbieg" value="男" style="margin-top: 2px"> 男
                                </div>

                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="huiyuan_Xingbieg" value="女" style="margin-top: 2px"> 女
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">联系电话</label>
                            <div class="col-sm-10">
                                <input type="number" name="phoneg" maxlength="11" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员积分</label>
                            <div class="col-sm-10">
                                <input type="number" name="huiyuan_Jifeng" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">紧急联系电话</label>
                            <div class="col-sm-10">
                                <input type="text" name="jinJi_Phoneg" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员类型</label>
                            <div class="col-sm-10">
                                <select name="huiyuanleixing_Idg" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员卡号</label>
                            <div class="col-sm-10">
                                <input type="text" name="huiyuan_Kahaog" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">卡内金额</label>
                            <div class="col-sm-10">
                                <input type="text" name="kanei_JinEg" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">付款方式</label>
                            <div class="col-sm-10">
                                <select name="chognzhi_Idg" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">密码</label>
                            <div class="col-sm-10">
                                <input type="text" name="miMag" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">操作店铺</label>
                            <div class="col-sm-10">
                                <select name="dianpu_Idg" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">经办人</label>
                            <div class="col-sm-10">
                                <select name="jinbanr_Idg" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">状态</label>
                            <div class="col-sm-10">
                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="zhuangtaig" value="1" style="margin-top: 2px">启动
                                </div>

                                <div class="radio-inline" style="margin-top: -8px">
                                    <input type="radio" name="zhuangtaig" value="2" style="margin-top: 2px"> 禁用
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-10">
                                <input type="text" name="beiZhug" class="form-control">
                            </div>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="doxgai()">修改</button>
                </div>
            </form>
        </div>
    </div>
</div>

<%--积分兑换--%>
<div class="modal inmodal" id="Div5" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <i class="fa fa-laptop modal-icon"></i>
                <h4 class="modal-title">会员积分兑换</h4>
            </div>
            <form method="post" class="form-horizontal">
                <div class="modal-body">
                    <div class="ibox-content">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员名称:</label>
                            <div class="col-sm-10">
                                <input style="border:none;";  name="huiyuan_Name" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">积分兑换:</label>
                            <div class="col-sm-10">
                                <input name="huiyuan_Jifenf" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注信息:</label>
                            <div class="col-sm-10">
                                <input name="beiZhuf" class="form-control">
                            </div>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="dojifen()">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<%--充值管理--%>
<div class="modal inmodal" id="Div1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <i class="fa fa-laptop modal-icon"></i>
                <h4 class="modal-title">会员充值</h4>
            </div>
            <form method="post" class="form-horizontal">
                <div class="modal-body">
                    <div class="ibox-content">

                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员编号</label>
                            <div class="col-sm-10">
                                <input name="Huiyuanchongzhi_Id" type="text" class="form-control">
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员名称</label>
                            <div class="col-sm-10">
                                <input name="Huiyuanchognzhi_Name" type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">充值金额</label>
                            <div class="col-sm-10">
                                <input  name="zhongzhijine" type="text" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">操作店铺</label>
                            <div class="col-sm-10">
                                <select name="dianpu_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">付款方式</label>
                            <div class="col-sm-10">
                                <select name="chognzhi_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">经办员工</label>
                            <div class="col-sm-10">
                                <select name="jinbanr_Id" class="form-control">

                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">备注</label>
                            <div class="col-sm-10">
                                <input  name="beizhu" type="text" class="form-control">
                            </div>
                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="dochognzhi()">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<%--套餐充值--%>
<div class="modal inmodal" style="height: 100%; width: 80%" id="Div2" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="height: 90%; width: 100%">
        <div class="modal-content animated bounceInRight" style="height: 100%; width: 100%">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
                </button>
                <i class="fa fa-laptop modal-icon"></i>
                <h3 style="margin-left: 200px;margin-top: 40px">套餐续费</h3>
            </div>
            <form method="post"  class="form-horizontal">
                <div class="modal-body" style="height: 70%; width: 80%">
                    <div class="ibox-content">

                        <div class="col-sm-10" style="margin-left: 40px;margin-top: 30px">
                            <label style="font-size: 16px; ">会员编号：</label>
                            <input style="border: 0px" name="taocanhuiyuan_id" type='text'/>

                            <label style="font-size: 16px;margin-left: 40px">会员姓名：</label>
                            <input style="border: 0px" name="taocanhuiyuan_Name" type='text'/>
                        </div>

                        <br>

                        <div class="col-sm-10">
                            <label style="margin-left: 40px;margin-top: 20px;font-size: 16px">操作店铺：</label>
                            <select name="dianpu_Id" style="width: 200px;height: 35px" >

                            </select>

                            <label style="margin-left: 10px;margin-top: 20px;font-size: 16px">经办员工：</label>
                            <select name="jinbanr_Id" style="width: 200px;height: 35px" >

                            </select>
                        </div>

                        <br>

                        <div class="col-sm-10">
                            <label style="margin-left: 40px;margin-top: 20px;font-size: 16px">实付金额：</label>
                            <input name="taocan_jiaofei">

                            <label style="margin-left: 30px;margin-top: 20px;font-size: 16px">付款方式：</label>
                            <select name="chognzhi_Id"  style="width: 200px;height: 35px">

                            </select>
                        </div>

                        <br>

                        <div class="col-sm-10">
                            <label style="margin-left: 40px;margin-top: 20px;font-size: 16px">备注：</label>
                            <input name="beizhu"  style="width: 400px">
                        </div>

                        <br>

                        <div class="col-sm-10" style="margin-top: 10px; margin-left: 50px">
                            <a onclick="xiangqing()" style="font-size: 20px">增加套餐</a>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="dotaocanchognzhitianjia()">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<%--选择套餐--%>
<div class="modal inmodal" id="hh" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" style="width: 60%">
        <div class="modal-content animated bounceInRight" style="height: 70%;">
            <form method="post"  class="form-horizontal">
                <div class="modal-body" style="height: 80%; width: 100%">
                    <div class="ibox-content">
                        <a style="font-size: 20px" onclick="xuanztaocan()">选择套餐</a>

                        <h4>项目信息</h4>
                        <div class="col-sm-10">
                            <label style="margin-top: 20px;font-size: 16px">名称：</label>
                            <input  disabled="disabled"  name="taocan_Name">

                            <label style="margin-top: 20px;font-size: 16px">项目类型：</label>
                            <input  disabled="disabled"  name="xiangmuleixing_Name">
                        </div>

                        <div class="col-sm-10">
                            <label style="margin-top: 20px;font-size: 16px">编码：</label>
                            <input disabled="disabled"   name="taocan_Id">

                            <label style="margin-top: 20px;font-size: 16px">单位：</label>
                            <input  disabled="disabled"  name="chanpindanwei_name">

                            <br>
                            <label style="margin-top: 20px;font-size: 16px">现价：</label>
                            <input id="jianqian" type="text" name="taocan_Jiage" disabled="disabled" >
                        </div>

                        <div class="col-sm-10">
                            <h4>续费信息</h4>
                            <label style="margin-top: 20px;font-size: 16px">数量：</label>
                            <input id="shuliang" name="shuliang">

                            <label  style="margin-top: 20px;font-size: 16px">总价：</label>
                            <input id="zongjia" type="text">

                        </div>

                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" onclick="doxuanztaocan()">提交</button>
                </div>
            </form>
        </div>
    </div>
</div>

<!--套餐详情模态框-->
<div class="modal inmodal" id="showtaocanxq">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <table id="dd" class="taocanxiangqing"></table>
        </div>
    </div>
</div>

<script>
    $(function () {
        $("#shuliang").bind("propertychange input",function () {
            var jianqian=$("#jianqian").val();
            var shuliang=$("#shuliang").val();
            $("#zongjia").val(Number(jianqian)*Number(shuliang))
        })
    })
</script>




</body>
</html>
